<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/part2admin/common/adminInit.jsp"%>


<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
	background-color: #F8F9FA;
}

h1 {
	margin-bottom: 50px;
	font-size: 40px;
	font-weight: normal;
}

p {
	margin: 0;
	padding: 0 0 30px;
	font-size: 12px;
}

pre {
	font-size: 12px;
	font-family: "Consolas", "Monaco", "Bitstream Vera Sans Mono",
		"Courier New", "Courier";
	line-height: 120%;
	background: #F4F4F4;
	padding: 10px;
}

#general {
	margin: 30px;
}

#add {
	display: none;
}

.popup {
	background: #FFF;
	border: 1px solid #333;
	padding: 1px;
}

.popup-header {
	height: 24px;
	padding: 7px;
	background: url("part2admin/common/js/box/bgr_popup_header.jpg")
		repeat-x;
}

.popup-header h2 {
	margin: 0;
	padding: 0;
	font-size: 18px;
	float: left;
}

.popup-header .close-link {
	float: right;
	font-size: 11px;
}

.popup-body {
	padding: 10px;
}

form {
	margin: 0;
	padding: 0;
}

form * {
	font-size: 12px;
}
-->
</style>
<link href="part2admin/images/skin.css" rel="stylesheet" type="text/css" />
<body>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
	<tr>
		<td width="17" height="29" valign="top"
			background="images/mail_leftbg.gif"><img
			src="part2admin/images/left-top-right.gif" width="17" height="29" /></td>
		<td width="935" height="29" valign="top"
			background="part2admin/images/content-bg.gif">
		<table width="100%" height="31" border="0" cellpadding="0"
			cellspacing="0" class="left_topbg" id="table2">
			<tr>
				<td height="31">
				<div class="titlebt">用户列表</div>
				</td>
				<td align="right"><a href="javascript:;" onClick="add()"
					title="add users"> <img src="part2admin/images/add.gif"
					border="0" alt="添加信息" title="添加信息" /></a></td>
			</tr>
		</table>
		</td>
		<td width="16" valign="top"
			background="part2admin/images/mail_rightbg.gif"><img
			src="part2admin/images/nav-right-bg.gif" width="16" height="29" /></td>
	</tr>
	<tr>
		<td height="71" valign="middle"
			background="part2admin/images/mail_leftbg.gif">&nbsp;</td>
		<td valign="top" bgcolor="#F7F8F9">

		<table width="100%" height="138" border="0" cellpadding="0"
			cellspacing="0">
			<tr>
				<td height="13" valign="top">&nbsp;</td>
			</tr>
			<tr>
				<td valign="top">
				<table width="98%" border="0" align="center" cellpadding="0"
					cellspacing="0">
					<tr>
						<td class="left_txt">当前位置：用户列表</td>
						<td class="left_txt" align="right"><a href="javascript:;"
							onClick="add()" title="add users"> <!--<a href="#" onClick="javaScript:TINY.box.show('newsAction.do?method=preAdd',1,0,0,1)">-->
						</a></td>
					</tr>
					<tr>
						<td height="20" colspan="2">
						<table width="100%" height="1" border="0" cellpadding="0"
							cellspacing="0" bgcolor="#CCCCCC">
							<tr>
								<td></td>
							</tr>
						</table>
						</td>
					</tr>
					<tr>
						<td colspan="2"></td>
					</tr>
					<tr>
						<td colspan="2"></td>
					</tr>
					<tr>
						<td colspan="2">
						<table width="80%" height="31" border="1" align="center"
							cellpadding="0" cellspacing="0" bordercolor="#FFFFFF">
							<tr align="center" class="nowtable">

								<td class="left_bt2" width="25%">用户名称</td>
								<td class="left_bt2" width="10%">密码</td>
								<td class="left_bt2" width="15%">权限</td>
								<td class="left_bt2" width="15%">添加日期</td>
								<td class="left_bt2" width="10%">操作</td>
							</tr>


							<logic:present name="page">
								<logic:iterate id="list" name="page" property="result"
									scope="request" indexId="indexid">
									<form name="usersForm" id="user${indexid}s" method="post"
										action="usersAction.do?method=edit"><input
										type="hidden" name="voa.value(users).field(id)"
										value="${list.userId}" />
									<tr align="center">
										<td class="left_txt"><input type="text" id="name"
											name="voa.value(users).field(name)" value="${list.userName}" /></td>
										<td class="left_txt"><input type="password" id="password"
											name="voa.value(users).field(password)" value="" /></td>
										<td class="left_txt"><select id="preview"
											name="voa.value(users).field(purview)">
											<logic:equal name="list" property="purview" value="0">
												<option value="0" selected="selected">管理员</option>
												<option value="1">查看</option>
												<option value="2">编辑</option>
											</logic:equal>
											<logic:equal name="list" property="purview" value="1">
												<option value="0">管理员</option>
												<option value="1" selected="selected">查看</option>
												<option value="2">编辑</option>
											</logic:equal>
											<logic:equal name="list" property="purview" value="2">
												<option value="0">管理员</option>
												<option value="1">查看</option>
												<option value="2" selected="selected">编辑</option>
											</logic:equal>
										</select></td>
										<td class="left_txt"><bean:write format="yyyy-MM-dd"
											name="list" property="createDate" /></td>
										<td class="left_txt"><a href="#"
											onClick="javascript: document.user${indexid}s.submit()"
											title="编辑"> <img src="part2admin/images/edit.gif"
											border="0" alt="编辑" title="编辑" /></a>&nbsp;&nbsp;&nbsp; <a
											href="usersAction.do?method=delete&id=${list.userId}"
											onClick="return confirm('确定删除${list.userName}信息?')"><img
											src="part2admin/images/delete.gif" border="0" alt="删除"
											title="删除" /></a></td>
									</tr>
									</form>
								</logic:iterate>
							</logic:present>


						</table>
						</td>
					</tr>
					<tr>

						<td colspan="2" align="center" class="left_txt"><logic:present
							name="page">
							<pager:pager action="newsAction.do?method=list" />
						</logic:present></td>
					</tr>
				</table>
				</td>
			</tr>

		</table>

		</td>
		<td background="part2admin/images/mail_rightbg.gif">&nbsp;</td>
	</tr>
	<tr>
		<td valign="middle" background="part2admin/images/mail_leftbg.gif"><img
			src="part2admin/images/buttom_left2.gif" width="17" height="17" /></td>
		<td height="17" valign="top"
			background="part2admin/images/buttom_bgs.gif"><img
			src="part2admin/images/buttom_bgs.gif" width="17" height="17" /></td>
		<td background="part2admin/images/mail_rightbg.gif"><img
			src="part2admin/images/buttom_right2.gif" width="16" height="17" /></td>
	</tr>
</table>
<!--添加分类div-->
<div id="add">
<div class="popup">
<div class="popup-header">
<h2>添加新用户</h2>
<a href="javascript:;" onClick="$.closePopupLayer('add')" title="Close"
	class="close-link"><img src="part2admin/common/js/box/close.png"
	border="0" /></a> <br clear="all" />
</div>
<div class="popup-body">
<table width="98%" border="0" align="center" cellpadding="0"
	cellspacing="1" bgcolor="#6699cc">
	<tr>
		<td height="20" bgcolor="#F7F8F9" class="left_txt" align="center">添加新用户</td>
	</tr>
	<tr>
		<td bgcolor="#FFFFFF">
		<table width="100%" border="0" align="left" cellpadding="1"
			cellspacing="1" bgcolor="#CCCCCC">
			<tr align="center" bgcolor="#f2f2f2" class="left_txt2" height="20">
				<td width="20%">用户名</td>
				<td width="13%">密码</td>
				<td width="13%">权限</td>
				<td width="13%"></td>
			</tr>
			<form name="usersForm" id="users" method="post"
				action="usersAction.do?method=add">
			<tr align="center" bgcolor="#FFFFFF">
				<td><input name="voa.value(users).field(name)" type="text"
					id="name" size="12"></td>
				<td><input name="voa.value(users).field(password)"
					type="password" id="password" size="12"></td>
				<td><select id="preview" name="voa.value(users).field(purview)">
					<option value="0">管理员</option>
					<option value="1">查看</option>
					<option value="2">编辑</option>
				</select></td>
				<td><input type="submit" name="add" value="添 加"></td>
			</tr>
			</form>
		</table>
		</td>
	</tr>
</table>


</div>
</div>
</div>
<!--添加分类div结束-->
<script type="text/javascript"> 
			//<![CDATA[
				$.setupJMPopups({
					screenLockerBackground: "#003366",
					screenLockerOpacity: "0.7"
				});
 
				function add() {
					$.openPopupLayer({
						name: "add",
						width: 550,
						target: "add"
					});
				}
				
			//]]>
		</script>
</body>
